from flask import Flask, url_for, request

app = Flask(__name__)


@app.route('/')
def hello():
    return 'Hello World!你好a1'


@app.route('/<name>')
def hello_name(name):
    return 'Hello %s!' % name


@app.route('/post/<int:post_id>')
def show_post(post_id):
    return 'post %s!' % post_id


@app.route("/url")
def get_url():
    return url_for("static", filename='css/style.css')


@app.route("/login", methods=['GET', 'POST', 'PUT'])
def login():
    if request.method == 'POST':
        return 'post'
    elif request.method == 'GET':
        return 'get'
    elif request.method == 'PUT':
        return 'put'


if __name__ == '__main__':
    app.debug = True
    app.run()
